//时间格式化
export function formatDate(row, column) {
// 获取单元格数据
let datac = row[column.property];
if(datac === null){
  return 
}
let dtc = new Date(datac);
//获取月,默认月份从0开始
let dtuMonth = dtc.getMonth() + 1;
//获取日
let dtuDay = dtc.getDate();
//处理1-9月前面加0
if (dtuMonth < 10) {
  dtuMonth = "0" + (dtc.getMonth() + 1);
}
//处理1-9天前面加0
if (dtuDay < 10) {
  dtuDay = "0" + dtc.getDate();
}
//获取小时
let dtuHours = dtc.getHours();
//处理1-9时前面加0
if (dtuHours < 10) {
  dtuHours = "0" + dtc.getHours();
}
//获取分钟
let dtuMinutes = dtc.getMinutes();
//处理1-9分前面加0
if (dtuMinutes < 10) {
  dtuMinutes = "0" + dtc.getMinutes();
}
//获取秒
let dtuSeconds = dtc.getSeconds();
//处理1-9秒前面加0
if (dtuSeconds < 10) {
  dtuSeconds = "0" + dtc.getSeconds();
}
//组装年月日时分秒,按自己的要求来
let dd =
  dtc.getFullYear() +
  "/" +
  dtuMonth +
  "/" +
  dtuDay +
  " " +
  dtuHours +
  ":" +
  dtuMinutes +
  ":" +
  dtuSeconds;
return (row.TableIsbibei = dd);
//+ " " + dtuHours + ":" + dtuMinutes + ":" + dtuSeconds
  
}
export function FormatTime(t, date) {
  if (date == null) {
    return
  } else {
    var date = new Date(date);
    var o = {
      "M+": date.getMonth() + 1,                 //月份
      "d+": date.getDate(),                    //日
      "h+": date.getHours(),                   //小时
      "m+": date.getMinutes(),                 //分
      "s+": date.getSeconds(),                 //秒
      "q+": Math.floor((date.getMonth() + 3) / 3), //季度
      "S": date.getMilliseconds()             //毫秒
    };
    if (/(y+)/.test(t)) {
      t = t.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
    };
    for (var k in o) {
      if (new RegExp("(" + k + ")").test(t)) {
        t = t.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
      };
    }
    return t;
  }
};